// ============================== 导入依赖 ============================== //

// ============================== 导出提交 ============================== //

export default {
  /**
   * 提交 await CORE.CONFIRM.prompt()
   */
  prompt(message, title = '提交') {
    const value = prompt(`${title}\n${message}`)
    return new Promise((resolve) => value && resolve(value))
  },

  /**
   * 信息 await CORE.CONFIRM.info()
   */
  info(message, title = '信息') {
    const value = prompt(`${title}\n${message}`)
    return new Promise((resolve) => value && resolve(value))
  },

  /**
   * 成功 await CORE.CONFIRM.success()
   */
  success(message, title = '成功') {
    const value = prompt(`${title}\n${message}`)
    return new Promise((resolve) => value && resolve(value))
  },

  /**
   * 失败 await CORE.CONFIRM.error()
   */
  error(message, title = '失败') {
    const value = prompt(`${title}\n${message}`)
    return new Promise((resolve) => value && resolve(value))
  },

  /**
   * 警告 await CORE.CONFIRM.warning()
   */
  warning(message, title = '警告') {
    const value = prompt(`${title}\n${message}`)
    return new Promise((resolve) => value && resolve(value))
  },
}
